package com.hunan.chinamobile.dto;

import com.hunan.chinamobile.constant.SysConstant;
import com.hunan.chinamobile.model.DeviceData;

public class DeviceDataDTO extends DeviceData {

    private String deviceName;
    private String baseStationName;
    private String cityName;
    private String param;
    private String showValue;

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getBaseStationName() {
        return baseStationName;
    }

    public void setBaseStationName(String baseStationName) {
        this.baseStationName = baseStationName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getParam() {
        switch (getType()){
            case 1:
                param = "电压信号";
                break;
            case 2:
                param = "光纤信号";
                break;
            case 3:
                param = "电压值";
                break;
            case 4:
                param = "NB信号强度";
                break;
            default:
                break;
        }
        return param;
    }

    public String getShowValue() {
        if(getType() == 4){
            showValue = SysConstant.getRssi((int)getValue().doubleValue());
        }else if(getType() == 3){
            if(getValue() != null && getValue() > 8000){
                showValue = "-"+getValue()%8000+"V";
            }else {
                showValue = getValue() + "V";
            }
        }else{
            showValue = (int)getValue().doubleValue()+"";
        }
        return showValue;
    }

    public void setShowValue(String showValue) {
        this.showValue = showValue;
    }

    public void setParam(String param) {
        this.param = param;
    }
}
